package com.firesrc.service;

import com.firesrc.service.client.AutoExecutorManager;
import com.firesrc.service.client.FetchKeywordExecutorManager;

public class ScheduleExecutorManagerFactory {

  private static SearchMailExecutorManager searchMailExecutorManager;
  private static SendMailExecutorManager sendMailExecutorManager;
  private static AutoExecutorManager autoExecutorManager;
  private static FetchKeywordExecutorManager fetchKeywordExecutorManager;

  public static synchronized SuperScheduledExecutorManager getSearchMailExecutorManager() {
    if (searchMailExecutorManager == null) {
      searchMailExecutorManager = new SearchMailExecutorManager();
    }
    return searchMailExecutorManager;
  }

  public static synchronized SuperScheduledExecutorManager getSendMailExecutorManager() {
    if (sendMailExecutorManager == null) {
      sendMailExecutorManager = new SendMailExecutorManager();
    }
    return sendMailExecutorManager;
  }

  public static AutoExecutorManager getAutoExecutorManager() {
    if (autoExecutorManager == null) {
      autoExecutorManager = new AutoExecutorManager();
    }
    return autoExecutorManager;
  }

  public static FetchKeywordExecutorManager getFetchKeywordExecutorManager() {
    if (fetchKeywordExecutorManager == null) {
      fetchKeywordExecutorManager = new FetchKeywordExecutorManager();
    }
    return fetchKeywordExecutorManager;
  }

}
